package mc.support.taobao.api;

import mc.support.taobao.api.fields.GetItemInfoFields;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.request.ItemGetRequest;
import com.taobao.api.response.ItemGetResponse;

/**
 * Created with IntelliJ IDEA. <br/>
 * User: francis    <br/>
 * Date: 13-11-19    <br/>
 * Time: 20:01  <br/>
 */
public class GetItemInfoReq extends AbstractReq<GetItemInfoReq, ItemGetResponse> {

    private GetItemInfoFields fields;
    private Long numIid;
    private String trackIid;

    @Override
    protected TaobaoRequest toRequest() {
        ItemGetRequest req=new ItemGetRequest();

        if ( null != fields ) {
            req.setFields( fields.toString() );
        }

        if ( null != numIid ) {
            req.setNumIid( numIid );
        }

        if ( null != trackIid ) {
            req.setTrackIid( trackIid );
        }

        return req;
    }

    public GetItemInfoReq fields(GetItemInfoFields fields) {
        this.fields = fields;
        return this;
    }

    public GetItemInfoReq numIid(Long numIid) {
        this.numIid = numIid;
        return this;
    }

    public GetItemInfoReq trackIid(String trackIid) {
        this.trackIid = trackIid;
        return this;
    }

}
